home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2002 January / maximum-cd-2002-01.iso / Files / Mechwarrior 4 Mapping / MW4Editor.exe / content / ABLScripts / Bots / WussyBot.abl < prev   
Encoding:
Text File  |  2001-07-16  |  2.7 KB  |  109 lines

  1.  
  2. fsm WussyBot : integer;
  3.  
  4.  
  5. //------------------------------------------------------------------
  6.  
  7. // WussyBot:
  8. //   A total pushover, and an easy target even for rank beginners.
  9.  
  10. //------------------------------------------------------------------
  11.  
  12.  
  13. //------------------------------------------------------------------
  14. //     Constants
  15. //------------------------------------------------------------------
  16.  
  17.     const
  18.         #include_ <content\ABLScripts\mwconst.abi>
  19.  
  20. //------------------------------------------------------------------
  21. //     Types
  22. //------------------------------------------------------------------
  23.  
  24.     type
  25.         #include_ <content\ABLScripts\mwtype.abi>
  26.     
  27.  
  28. //------------------------------------------------------------------
  29. //     Variables
  30. //------------------------------------------------------------------
  31.  
  32.     var
  33.         static integer            attackRange;        // At what range do I start shooting?
  34.         static integer            withdrawRange;        // At what range do I withdraw?
  35.  
  36. //------------------------------------------------------------------
  37. //     Init: my initialization function
  38. //------------------------------------------------------------------
  39.  
  40. function Init;
  41.     code
  42.         // script-specific variables
  43.         attackRange        = 9999;
  44.         withdrawRange    = 9999;
  45.  
  46.         // driver settings
  47.         SetFiringDelay            (ME,3.0,8.0);
  48.         SetIgnoreFriendlyFire    (ME,true);
  49.         SetIsShotRadius            (ME,120);
  50.         SetEntropyMood            (ME,DEFENSIVE_START);
  51.         SetCurMood                (ME,DEFENSIVE_START);
  52.         SetSkillLevel            (ME,0,0,0);
  53.         SetAttackThrottle        (ME,36);
  54.  
  55.         EnablePerWeaponRayCasting    (ME,TRUE);
  56.  
  57. endfunction;
  58.  
  59. //------------------------------------------------------------------
  60. //    StartState: my initial state
  61. //------------------------------------------------------------------
  62.  
  63. state StartState;
  64.  
  65.     code
  66.         trans WaitToAmbushState;
  67.  
  68. endstate;
  69.  
  70. //------------------------------------------------------------------
  71. //    WaitInAmbushState: wait for someone to come close enough to attack
  72. //------------------------------------------------------------------
  73.  
  74. state WaitToAmbushState;
  75.     code
  76.         if (Bot_FindEnemy(attackrange)) then
  77.             trans AttackState;
  78.         endif;
  79.  
  80.         OrderMoveLookOut;
  81. endstate;
  82.  
  83. //------------------------------------------------------------------
  84. //    AttackState: the ambush is over -- let's kick some ass!
  85. //------------------------------------------------------------------
  86.  
  87. state AttackState;
  88.     code
  89.         if (LeaveAttackState(withdrawRange)) then
  90.             trans WaitToAmbushState;
  91.         endif;
  92.  
  93.         OrderAttack(TRUE);
  94. endstate;
  95.  
  96. //------------------------------------------------------------------
  97. //    DeadState: OK, I kicked the bucket.
  98. //------------------------------------------------------------------
  99.  
  100. state DeadState;
  101.     code
  102.         orderDie;
  103.  
  104. endstate;
  105.  
  106.  
  107. endfsm.
  108.  
  109.